<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%> 
<%@ page import="java.util.List"%>
<%@ page import="com.dp.vo.TChannels"%>
<%@ page import="com.dp.pojo.News"%>

<%

List<TChannels> t=(List<TChannels>)session.getAttribute("channelsList");
List<News> n = (List<News>)session.getAttribute("imgNewsList");
String channelId = t.get(0).getChannelId();
String pics = "'";
String links="'";
String texts="'";
for(int i=0;i<n.size();i++){
    	pics =pics+path+"/yc/channel/ycchannel!image.do?rid="+n.get(i).getResourceRid();
	links =links+path+"/yc/news/ycimgnews!imgnews.do?contentId="+n.get(i).getContentId();
	
	
	texts += n.get(i).getContentName();
	if(i<n.size()-1){
	    pics += "|";
	    links += "|";
	    texts += "|";
	}
}
pics += "'";
links+="'";
texts+="'";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>伊春鹿鸣矿业有限公司</title>
 <%@include file="ycinc/include.jsp" %>
</head>
<body>
<div id="wrap">
  <%@include file="ycinc/head.jsp" %>
  <%@include file="ycinc/nav.jsp"%>
  <%@include file="ycinc/main.jsp"%>
 <%@include file="ycinc/foot.jsp" %>
 </div>
 
<!-- slider js start -->
<SCRIPT type="text/javascript">
	(function($){
		$.fn.extend({
			slider:function(o){
				o=$.extend({
					isAuto:false,
					autoDurTime:5000,
					prevCurObj:null,
					nextCurObj:null,
					navMenuObj:null,
					navCurrentClassName:'on',
					navControlType:'click',
					itemCurrentClassName:'current',
					playType:'fade',
					durTime:1000,
					startIndex:0,
					effectTween:'easeIn'
				},o||{})
				
				//参数
				var currentIndex=null;
				var autoFlag=null;
				var timeoutFlag1=null;
				var timeoutFlag2=null;
				var prevFlag=null;
				var nextFlag=null;
				var timeout=5000;
				var _self=$(this);
				var maxItemNum=_self.size();
				var ready=null;
				var effectTween=o.effectTween;
				var movedir1=movedir2=null;
				
				//切换
				function play(n,dir){
					if(currentIndex==n) return;
					
					_self.eq(currentIndex).removeClass(o.itemCurrentClassName);
					_self.eq(n).addClass(o.itemCurrentClassName);
					
					if(o.navMenuObj){
						$(o.navMenuObj).removeClass(o.navCurrentClassName).eq(n).addClass(o.navCurrentClassName);
					}
					if(o.durTime<=0){
						_self.eq(currentIndex).hide();
						_self.eq(n).show();
					}else if(o.playType=='fade'){
						_self.eq(currentIndex).fadeOut(o.durTime);
						_self.eq(n).fadeIn(o.durTime);
					}else{	
						var temp=currentIndex;	
						if(dir=='prev'){
							movedir1='-';
							movedir2='+';
						}else{
							movedir1='+';
							movedir2='-';
						}
						_self.eq(currentIndex).css({'left':'0px','display':'block'});
						_self.eq(n).css({'left':movedir1+'208px','display':'block'});
						_self.eq(currentIndex).animate({'left':movedir2+'208px'},300,effectTween)
						_self.eq(n).animate({'left':'0px'},300,effectTween)
					}					
					
					currentIndex=n;
					ready=false;
				}
				
				//向前和向后
				function whichOne(dir){
					if(ready) return;
					ready=true;
					var futureIndex=currentIndex;
					if(dir=='next'){
						futureIndex++;
						if(futureIndex>=maxItemNum){
							futureIndex=0;
						}
					}else{
						futureIndex--;
						if(futureIndex<0){
							futureIndex=maxItemNum-1;
						}
					}
					play(futureIndex,dir);
				}
				
				//清除自动和timeout
				function clearJam(){
					clearInterval(autoFlag);
					clearTimeout(timeoutFlag1);
					clearTimeout(timeoutFlag2);
				}
				
				//自动播放	
				function auto(){	
						clearTimeout(timeoutFlag1);
						clearTimeout(timeoutFlag2);
						autoFlag=setInterval(function(){
							whichOne('next');
						},o.autoDurTime);
				}
				
				//导航事件绑定
				if(o.navMenuObj){
					if(o.navControlType=='click'){
						$(o.navMenuObj).on('click',function(){
							clearJam();
							var curDot=$(o.navMenuObj).index(this);
							play(curDot);
						})
					}else{
						$(o.navMenuObj).hover(function(){
							clearJam();
							var curDot=$(o.navMenuObj).index(this);
							play(curDot);
						})
					}
				}
				
				//左右按钮事件绑定
				if(o.prevCurObj){						
					$(o.prevCurObj).on('click',function(){	
						clearJam();
						if(_self.queue().length<1){	
						whichOne('next');
						}
						if(o.isAuto){
							timeoutFlag1=setTimeout(auto,timeout);							
						}
						return false;
					})
				}
				if(o.nextCurObj){
					$(o.nextCurObj).on('click',function(){
						clearJam();
						if(_self.queue().length<1){							
						whichOne('prev');
						}
						if(o.isAuto){
							timeoutFlag2=setTimeout(auto,timeout);							
						}
						return false;
					})
				}
				
				//初始化
				_self.hide().eq(o.startIndex).show();
				if(o.navMenuObj){
						$(o.navMenuObj).removeClass(o.navCurrentClassName).eq(o.startIndex).addClass(o.navCurrentClassName);
				}
				if(o.isAuto) auto();
			}
		})
	})(jQuery)		
	
</SCRIPT>

<SCRIPT type="text/javascript">
	$('.sliderBox li').slider({
		navMenuObj:'.snum span',//导航对象
		prevCurObj:'.nextCur',//向前按钮对象
		nextCurObj:'.prevCur',//向后按钮对象
		isAuto:true,//是否自动滚动 自动滚动：true；不自动滚动：false
		playType:'slide',//消息效果 fade或slide
		effectTween:'easeIn'//缓动效果'easeIn','easeOut','easeInOut,'expoin','expoout','expoinout','bouncein','bounceout','bounceinout','elasin','elasout','elasinout','backin','backout','backinout'
	})
	$('.tabcon .newsitem').slider({
		navMenuObj:'.tabs li',//导航对象
		prevCurObj:'.nextCur2',//向前按钮对象
		nextCurObj:'.prevCur2',//向后按钮对象
		isAuto:false,//是否自动滚动 自动滚动：true；不自动滚动：false
		playType:'slide',//消息效果 fade或slide
		durTime:0,
		navControlType:'hover',
		effectTween:'easeIn'//缓动效果'easeIn','easeOut','easeInOut,'expoin','expoout','expoinout','bouncein','bounceout','bounceinout','elasin','elasout','elasinout','backin','backout','backinout'
	})
</SCRIPT>
</body>
</html>